<?php if (!defined('THINK_PATH')) exit(); /*a:5:{s:101:"/www/wwwroot/wait2024.cn/canying_fastadmin/public/../application/admin/view/fzdc/goods/goods/add.html";i:1741255087;s:85:"/www/wwwroot/wait2024.cn/canying_fastadmin/application/admin/view/layout/default.html";i:1741180601;s:82:"/www/wwwroot/wait2024.cn/canying_fastadmin/application/admin/view/common/meta.html";i:1741180601;s:91:"/www/wwwroot/wait2024.cn/canying_fastadmin/application/admin/view/fzdc/goods/goods/sku.html";i:1741180601;s:84:"/www/wwwroot/wait2024.cn/canying_fastadmin/application/admin/view/common/script.html";i:1741180601;}*/ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
<title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="renderer" content="webkit">
<meta name="referrer" content="never">
<meta name="robots" content="noindex, nofollow">

<link rel="shortcut icon" href="/assets/img/favicon.ico" />
<!-- Loading Bootstrap -->
<link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo htmlentities(\think\Config::get('site.version') ?? ''); ?>" rel="stylesheet">

<?php if(\think\Config::get('fastadmin.adminskin')): ?>
<link href="/assets/css/skins/<?php echo htmlentities(\think\Config::get('fastadmin.adminskin') ?? ''); ?>.css?v=<?php echo htmlentities(\think\Config::get('site.version') ?? ''); ?>" rel="stylesheet">
<?php endif; ?>

<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
  <script src="/assets/js/html5shiv.js"></script>
  <script src="/assets/js/respond.min.js"></script>
<![endif]-->
<script type="text/javascript">
    var require = {
        config:  <?php echo json_encode($config ?? ''); ?>
    };
</script>

    </head>

    <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
        <div id="main" role="main">
            <div class="tab-content tab-addtabs">
                <div id="content">
                    <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                            <section class="content-header hide">
                                <h1>
                                    <?php echo __('Dashboard'); ?>
                                    <small><?php echo __('Control panel'); ?></small>
                                </h1>
                            </section>
                            <?php if(!IS_DIALOG && !\think\Config::get('fastadmin.multiplenav') && \think\Config::get('fastadmin.breadcrumb')): ?>
                            <!-- RIBBON -->
                            <div id="ribbon">
                                <ol class="breadcrumb pull-left">
                                    <?php if($auth->check('dashboard')): ?>
                                    <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
                                    <?php endif; ?>
                                </ol>
                                <ol class="breadcrumb pull-right">
                                    <?php foreach($breadcrumb as $vo): ?>
                                    <li><a href="javascript:;" data-url="<?php echo htmlentities($vo['url'] ?? ''); ?>"><?php echo htmlentities($vo['title'] ?? ''); ?></a></li>
                                    <?php endforeach; ?>
                                </ol>
                            </div>
                            <!-- END RIBBON -->
                            <?php endif; ?>
                            <div class="content">
                                <style>
    .col-tags span.tag {
        color: #409eff;
    }
</style>
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="panel-heading">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#basic" data-toggle="tab">基础信息</a></li>
            <li><a href="#sku" data-toggle="tab">库存/规格</a></li>
        </ul>
    </div>
    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div id="basic" class="tab-pane fade active in">

                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2"><?php echo __('Type_id'); ?>:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-type_id" data-rule="required" data-source="fzdc/goods/type/index"
                               class="form-control selectpage" name="row[type_id]" type="text" value="" data-params='{"custom[store_ids]":["in",<?php echo json_encode($store_ids); ?>]}'>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2"><?php echo __('Title'); ?>:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-title" class="form-control" name="row[title]" type="text" value="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2"><?php echo __('Tags'); ?>:</label>
                    <div class="col-xs-12 col-sm-8 col-tags">
                        <input id="c-tags" class="form-control selectpage" data-source="fzdc/goods/type/tag"
                               name="row[tags]" type="text" value="">
                    </div>
                </div>
                <div class="form-group" style="display: none;">
                    <label class="control-label col-xs-12 col-sm-2"><?php echo __('Switch'); ?>:</label>
                    <div class="col-xs-12 col-sm-8">

                        <input id="c-switch" name="row[switch]" type="hidden" value="0">
                        <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-switch"
                           data-yes="1" data-no="0">
                            <i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>
                        </a>
                    </div>
                </div>
                <div class="form-group" data-favisible="switch=0">
                    <label class="control-label col-xs-12 col-sm-2"><?php echo __('Store_ids'); ?>:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-store_ids" data-rule="required" data-source="fzdc/store/store/index"
                               data-field="title" data-multiple="false" class="form-control selectpage"
                               name="row[store_ids]" type="text" value="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2"><?php echo __('Image'); ?>:</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="input-group">
                            <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="">
                            <div class="input-group-addon no-border no-padding">
                                <span><button type="button" id="faupload-image" class="btn btn-danger faupload"
                                              data-input-id="c-image"
                                              data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp"
                                              data-multiple="false" data-preview-id="p-image"><i
                                        class="fa fa-upload"></i> <?php echo __('Upload'); ?></button></span>
                                <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose"
                                              data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i
                                        class="fa fa-list"></i> <?php echo __('Choose'); ?></button></span>
                            </div>
                            <span class="msg-box n-right" for="c-image"></span>
                        </div>
                        <ul class="row list-inline faupload-preview" id="p-image"></ul>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2"><?php echo __('详情图'); ?>:</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="input-group">
                            <input id="c-images" class="form-control" size="50" name="row[images]" type="text" value="">
                            <div class="input-group-addon no-border no-padding">
                                <span><button type="button" id="faupload-images" class="btn btn-danger faupload"
                                              data-input-id="c-images"
                                              data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp"
                                              data-multiple="true" data-preview-id="p-images"><i
                                        class="fa fa-upload"></i> <?php echo __('Upload'); ?></button></span>
                                <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose"
                                              data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i
                                        class="fa fa-list"></i> <?php echo __('Choose'); ?></button></span>
                            </div>
                            <span class="msg-box n-right" for="c-images"></span>
                        </div>
                        <ul class="row list-inline faupload-preview" id="p-images"></ul>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2"><?php echo __('详情'); ?>:</label>
                    <div class="col-xs-12 col-sm-8">
                        <textarea id="c-json" class="form-control editor" rows="5" name="row[json]"
                                  cols="50"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2"><?php echo __('出货类型'); ?>:</label>
                    <div class="col-xs-12 col-sm-8">

                        <div class="radio">
                            <?php if(is_array($shipmentList) || $shipmentList instanceof \think\Collection || $shipmentList instanceof \think\Paginator): if( count($shipmentList)==0 ) : echo "" ;else: foreach($shipmentList as $key=>$vo): ?>
                            <label for="row[shipment]-<?php echo htmlentities($key ?? ''); ?>"><input id="row[shipment]-<?php echo htmlentities($key ?? ''); ?>" name="row[shipment]"
                                                                     type="radio" value="<?php echo htmlentities($key ?? ''); ?>" <?php if(in_array(($key), explode(',',"1"))): ?>checked<?php endif; ?> /> <?php echo htmlentities($vo ?? ''); ?></label>
                            <?php endforeach; endif; else: echo "" ;endif; ?>
                        </div>

                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2"><?php echo __('商品类型'); ?>:</label>
                        <div class="col-xs-12 col-sm-8">
                            <?php echo build_radios('row[type]', ['1'=>__('单规格'), '2'=>__('多规格')]); ?>
                        </div>
                </div>
                <div class="form-group" data-favisible="type=1">
                    <label class="control-label col-xs-12 col-sm-2"><?php echo __('价格'); ?>:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input type="text" class="form-control" id="price" name="row[price]" value="0" data-rule="required"/>
                        </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2"><?php echo __('State'); ?>:</label>
                    <div class="col-xs-12 col-sm-8">

                        <div class="radio">
                            <?php if(is_array($stateList) || $stateList instanceof \think\Collection || $stateList instanceof \think\Paginator): if( count($stateList)==0 ) : echo "" ;else: foreach($stateList as $key=>$vo): ?>
                            <label for="row[state]-<?php echo htmlentities($key ?? ''); ?>"><input id="row[state]-<?php echo htmlentities($key ?? ''); ?>" name="row[state]" type="radio"
                                                                  value="<?php echo htmlentities($key ?? ''); ?>" <?php if(in_array(($key), explode(',',"1"))): ?>checked<?php endif; ?>
                                /> <?php echo htmlentities($vo ?? ''); ?></label>
                            <?php endforeach; endif; else: echo "" ;endif; ?>
                        </div>

                    </div>
                </div>
                <div class="form-group">
                    <label for="weigh" class="control-label col-xs-12 col-sm-2"><?php echo __('权重'); ?>:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input type="text" class="form-control" id="weigh" name="row[weigh]" value="0" data-rule="required"/>
                    </div>
                </div>
            </div>
            <div class="tab-pane fade" id="sku">
                <div class="goods-spec-many form-grou">
                    <style>
    .panel-default {
        margin-top: 10px;
        margin-bottom: 0px
    }

    .fzdc_goods {
        padding: 10px 4px
    }

    .tag-content {
        padding-top: 5px
    }

    .tag-content span {
        margin-right: 10px;
    }

    .tag-content span i {
        cursor: pointer
    }

    .input-group-addon {
        padding: 6px
    }

    .fzdc_content_b {
        overflow-x: auto;
        display: block;
        margin-top: 10px;
        border: 1px solid #ddd
    }

    .fzdc_content {
        width: 900px;
    }

    .fzdc_content tr td {
        white-space: nowrap
    }
</style>
<div class="form-group">
    <label class="control-label col-xs-12 col-sm-2">库存/规格</label>
    <div id="app" v-cloak class="col-xs-12 col-sm-8">
        <div class="input-group"><input type="text" class="form-control" placeholder="输入规格名称" ref="attr-group-name">
            <span class="input-group-addon pointer" style="cursor: pointer" @click="addRow">添加规格</span></div>
        <!-- 规格项 -->
        <div class="sku-content">
            <div class="panel panel-default" v-for="(v, i) in attrGroups">
                <header class="panel-heading text-center">
                    <b>{{v}}</b>
                    <i class="pull-right fa fa-trash pointer text-danger" @click="removeGroup(i)"></i></header>
                <div class="row row-content fzdc_goods">
                    <div class="col-md-6 col-sm-6 col-xs-6">
                        <div class="input-group">
                            <input type="text" class="form-control" :ref="`attr-item-name-${i}`">
                            <span class="input-group-addon pointer" @click="addChild(i)">添加</span>
                        </div>
                    </div>
                    <div class="col-md-12 col-sm-12 col-xs-12 tag-content">
                        <span class="tag" v-for="(vv, j) in attrItems[i]">{{vv}} <i
                                class="fa fa-minus-circle pointer text-danger" @click="removeChild(i, j)"></i></span>
                    </div>
                </div>
            </div>
        </div>

        <div class=" panel-default fzdc_content_b" v-show="attrGroups.length">
            <div class="fzdc_content">
                <table class="table  attr-table">
                    <thead>
                    <tr>
                        <th v-for="(v, i) in attrGroups">
                            {{v}}
                        </th>
                        <th width="140">原价</th>
                        <th width="140">现价</th>
                        <th width="140">库存</th>
                        <th width="140">编码</th>
                        <th width="80" style="text-align:center;">图片</th>
                        <th width="80" style="text-align:center;">状态</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr v-for="(v, i) in productSkus" :class="v.status==1?'':'disabled'">
                        <td v-for="(vv, j) in v.attr" width="80">
                            {{vv}}
                        </td>
                        <td width="80">
                            <input type="number" name="dsd" class="input-sm form-control attr-market_price"
                                   v-model="v.market_price">
                        </td>
                        <td width="80">
                            <input type="number" class="input-sm form-control attr-price" v-model="v.price">
                        </td>
                        <td width="80">
                            <input type="number" class="input-sm form-control attr-stock" v-model="v.stock">
                        </td>
                        <td width="80">
                            <input type="text" class="input-sm form-control attr-sn" v-model="v.sn">
                        </td>
                        <td width="80" style="text-align:center;">
                            <div class="sku-img" @click="upimage(i)">
                                <img v-if="v.image==''" src="/assets/addons/fzdc/img/upload.png" width="30">
                                <div v-else>
                                    <img :src="v.image">
                                    <i class="fa fa-minus-circle text-danger img-trash" @click.stop="delimage(i)"></i>
                                </div>
                            </div>
                        </td>
                        <td width="80" style="text-align:center;">
                            <input type="hidden" class="input-sm form-control attr-status" v-model="v.status">
                            <i v-if="v.status==1" class="fa fa-toggle-on text-success fa-2x" @click="toggle(i,0)"></i>
                            <i v-else class="fa fa-toggle-off text-gray fa-2x" @click="toggle(i,1)"></i>
                        </td>
                    </tr>
                    <tr>
                        <td :colspan="attrGroups.length" width="80">批量设置</td>
                        <td>
                            <div class="input-group "><input type="number" ref="batch-market_price"
                                                             class="form-control no-padding text-center"> <span
                                    @click="batchSetAttrs('market_price')" class="input-group-addon pointer">设置</span>
                            </div>
                        </td>
                        <td>
                            <div class="input-group "><input type="number" ref="batch-price"
                                                             class="form-control no-padding text-center"> <span
                                    @click="batchSetAttrs('price')" class="input-group-addon pointer">设置</span></div>
                        </td>
                        <td>
                            <div class="input-group"><input type="number" ref="batch-stock"
                                                            class="form-control no-padding text-center"> <span
                                    @click="batchSetAttrs('stock')" class="input-group-addon pointer">设置</span></div>
                        </td>
                        <td>
                            <div class="input-group"><input type="text" ref="batch-sn" class="form-control"> <span
                                    @click="batchSetAttrs('sn')" class="input-group-addon pointer">设置</span></div>
                        </td>
                    </tr>
                    </tbody>
                </table>
                <div class="hide">
                    <input type="text" name="row[skus]" :value="productSkusStr">
                    <input type="text" name="row[groups]" :value="attrGroupsStr">
                    <input type="text" name="row[items]" :value="attrItemsStr">
                </div>
            </div>
        </div>
    </div>
</div>
                </div>
            </div>
        </div>

    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled"><?php echo __('OK'); ?></button>
            <button type="reset" class="btn btn-default btn-embossed"><?php echo __('Reset'); ?></button>
        </div>
    </div>
</form>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="/assets/js/require.min.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version'] ?? ''); ?>"></script>

    </body>
</html>
